]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Don't move focus unconditionally
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 9 Oct 2017 22:04:56 +0000 (00:04 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 13 Apr 2018 14:13:35 +0000 (14:13 +0000)
Since commit 1939e22c22c, we move the keyboard focus with the hover
highlight. However while this makes sense when interacting with
the window picker, it interferes with keyboard navigation of other
components like dash or top bar. Address this by only moving the
focus when the previous focus was already inside the window picker
or unset.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/50

js/ui/workspace.js

index d049eae61d8c86ec34eb1d2acb64604bc3ccbbcd..1e121b7787ef697112a0c05844dba710ce20fd70 100644 (file)
@@ -660,7 +660,6 @@ var WindowOverlay = new Lang.Class({
         if (this._hidden)
             return;
 
-        this._windowClone.actor.grab_key_focus();
         this._animateVisible();
         this.emit('show-close-button');
     },
@@ -1852,7 +1851,12 @@ var Workspace = new Lang.Class({
 
         this.actor.add_actor(clone.actor);
 
-        overlay.connect('show-close-button', this._onShowOverlayClose.bind(this));
+        overlay.connect('show-close-button', () => {
+            let focus = global.stage.key_focus;
+            if (focus == null || this.actor.contains(focus))
+                clone.actor.grab_key_focus();
+            this._onShowOverlayClose(overlay);
+        });
 
         if (this._windows.length == 0)
             clone.setStackAbove(null);